package com.game.btnClass
{
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	
	public class BtnClass_goto extends AddMouseEvent
	{
		private var _isTaraget:Boolean;
		public function BtnClass_goto(sp:DisplayObject, click:Function=null, mouseOut:Function=null, mouseOver:Function=null,isTarget:Boolean=false)
		{
			_isTaraget=isTarget;
			super(sp, click, mouseOut, mouseOver);
		}
		override protected function mouseOut(event:MouseEvent):void{
			var _mc:MovieClip=event.currentTarget as MovieClip;
			_mc.gotoAndStop(1);
			if(_mouseOut!=null){
				_mouseOut()
			}
		}
		override protected function mouseOver(event:MouseEvent):void{
			var _mc:MovieClip=event.currentTarget as MovieClip;
			_mc.gotoAndStop(2);
			if(_mouseOver!=null){
				_mouseOver()
			}
		}
		override protected function  onClick(event:MouseEvent):void{
			var _mc:MovieClip=event.currentTarget as MovieClip;
			_mc.gotoAndStop(1);
			
			if(_isTaraget){
				_clickFun(event);
			}else{
				_clickFun();
			}
		}
	}
}